home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  3.9 KB  |  115 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CommResources.p
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1988-1998, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CommResources;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __COMMRESOURCES__}
  28. {$SETC __COMMRESOURCES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CommResourcesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __OSUTILS__}
  35. {$I OSUtils.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __CONDITIONALMACROS__}
  38. {$I ConditionalMacros.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. CONST
  48.                                                                 {     tool classes (also the tool file types)     }
  49.     classCM                        = 'cbnd';
  50.     classFT                        = 'fbnd';
  51.     classTM                        = 'tbnd';
  52.  
  53.                                                                 {     version of the Comm Resource Manager     }
  54.     curCRMVersion                = 2;                            {  constants general to the use of the Communications Resource Manager  }
  55.     crmType                        = 9;                            {  queue type     }
  56.     crmRecVersion                = 1;                            {  version of queue structure  }
  57.                                                                 {     error codes  }
  58.     crmGenericError                = -1;
  59.     crmNoErr                    = 0;
  60.  
  61. { data structures general to the use of the Communications Resource Manager }
  62.  
  63. TYPE
  64.     CRMErr                                = OSErr;
  65.     CRMRecPtr = ^CRMRec;
  66.     CRMRec = RECORD
  67.         qLink:                    QElemPtr;                                { reserved }
  68.         qType:                    INTEGER;                                { queue type -- ORD(crmType) = 9 }
  69.         crmVersion:                INTEGER;                                { version of queue element data structure }
  70.         crmPrivate:                LONGINT;                                { reserved }
  71.         crmReserved:            INTEGER;                                { reserved }
  72.         crmDeviceType:            LONGINT;                                { type of device, assigned by DTS }
  73.         crmDeviceID:            LONGINT;                                { device ID; assigned when CRMInstall is called }
  74.         crmAttributes:            LONGINT;                                { pointer to attribute block }
  75.         crmStatus:                LONGINT;                                { status variable - device specific }
  76.         crmRefCon:                LONGINT;                                { for device private use }
  77.     END;
  78.  
  79. FUNCTION InitCRM: CRMErr;
  80. FUNCTION CRMGetHeader: QHdrPtr;
  81. PROCEDURE CRMInstall(crmReqPtr: CRMRecPtr);
  82. FUNCTION CRMRemove(crmReqPtr: CRMRecPtr): OSErr;
  83. FUNCTION CRMSearch(crmReqPtr: CRMRecPtr): CRMRecPtr;
  84. FUNCTION CRMGetCRMVersion: INTEGER;
  85. FUNCTION CRMGetResource(theType: ResType; theID: INTEGER): Handle;
  86. FUNCTION CRMGet1Resource(theType: ResType; theID: INTEGER): Handle;
  87. FUNCTION CRMGetIndResource(theType: ResType; index: INTEGER): Handle;
  88. FUNCTION CRMGet1IndResource(theType: ResType; index: INTEGER): Handle;
  89. FUNCTION CRMGetNamedResource(theType: ResType; name: Str255): Handle;
  90. FUNCTION CRMGet1NamedResource(theType: ResType; name: Str255): Handle;
  91. PROCEDURE CRMReleaseResource(theHandle: Handle);
  92. FUNCTION CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  93. FUNCTION CRMGetToolNamedResource(procID: INTEGER; theType: ResType; name: Str255): Handle;
  94. PROCEDURE CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  95. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  96. FUNCTION CRMLocalToRealID(bundleType: ResType; toolID: INTEGER; theType: ResType; localID: INTEGER): INTEGER;
  97. FUNCTION CRMRealToLocalID(bundleType: ResType; toolID: INTEGER; theType: ResType; realID: INTEGER): INTEGER;
  98. FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  99. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  100. FUNCTION CRMIsDriverOpen(driverName: Str255): BOOLEAN;
  101. FUNCTION CRMParseCAPSResource(theHandle: Handle; selector: ResType; VAR value: UInt32): CRMErr;
  102. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  103. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  104.  
  105. {$ALIGN RESET}
  106. {$POP}
  107.  
  108. {$SETC UsingIncludes := CommResourcesIncludes}
  109.  
  110. {$ENDC} {__COMMRESOURCES__}
  111.  
  112. {$IFC NOT UsingIncludes}
  113.  END.
  114. {$ENDC}
  115.